import {createStore, combineReducers, applyMiddleware} from 'redux';
import createSagaMiddleware from 'redux-saga';
import {loginReducer, menuDataReducer} from './reducers/reducers';

import counterSagas from './saga/index';

// 全局创建多个reducer 在这里统一在一起
const rootReducers = combineReducers({loginReducer, menuDataReducer});

const sagaMiddleware = createSagaMiddleware();

const store = createStore(rootReducers, applyMiddleware(sagaMiddleware));

sagaMiddleware.run(counterSagas);


export default store;
